package com.d.ding.constants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * （已废弃）
 * 钉钉表单相关映射
 * 后期可将此类数据持久到数据库中配置，自动化管理
 */
public class DingFromConstants {


    //key,对应ding_talk表的type值 :调用此业务所对应的方法
    public static Map<Integer, String> dingProcessQueryDataMethodJoin = new HashMap<Integer, String>() {
        {
            put(6, "getAssetPurchaseDataById");
        }
    };

    /**
     * 资产采购流程对应钉钉字段
     */
    public final static List<DingFromComponentValueBean> assetPurchaseOrderapproveFrom = new ArrayList<DingFromComponentValueBean>() {
        {
            //
            add(new DingFromComponentValueBean("采购单标识",2,"batchId",""));
            add(new DingFromComponentValueBean("申请人",4,"dingUserId",""));
            add(new DingFromComponentValueBean("申请部门",4,"dingDeptId",""));
            add(new DingFromComponentValueBean("申请时间",1,"createdTime",""));
            add(new DingFromComponentValueBean("采购商品",6,"purchaseDetails","assetPurchaseOrderapproveFromItem"));
        }
    };
    /**
     * 资产采购流程表单子项钉钉字段
     */
    public final static List<DingFromComponentValueBean> assetPurchaseOrderapproveFromItem = new ArrayList<DingFromComponentValueBean>() {
        {
            //
            add(new DingFromComponentValueBean("申请部门",1,"orgName",""));
            add(new DingFromComponentValueBean("图片",4,"imgs",""));
            add(new DingFromComponentValueBean("商品名称",1,"name",""));
            add(new DingFromComponentValueBean("商品数量",2,"num",""));
            add(new DingFromComponentValueBean("商品金额",2,"costPrice",""));
        }
    };

    //此处可根据自己的业务情况涉及
    //用作钉钉连接器状态关联
    //key=node(同意的状态)，value=拒绝的状态
    public static Map<Integer, Integer> dingProcessSysStatusJoin = new HashMap<Integer, Integer>() {
        {
            //部门审核通过  驳回
            put(2, 1);
            //重复的财务审核通过不做状态更改，驳回更改
            put(-5, 3);
            //财务审核通过   驳回
            put(6, 3);

        }
    };
}
